"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * 获取对象长度
 * 数组返回.length
 * 对象返回Object.keys().length
 * 其他返回0
 * @param value
 */
function getLength(value) {
    if (null == value) {
        return 0;
    }
    else if (Array.isArray(value)) {
        return value.length;
    }
    else if (typeof value === 'object') {
        return Object.keys(value).length;
    }
    return 0;
}
exports.getLength = getLength;
let uuidIndex = 0;
/**
 * 生成唯一ID
 * @param prefix 前缀
 */
function generateUUID(prefix = '') {
    return prefix + '_' + Date.now() + '_' + uuidIndex++;
}
exports.generateUUID = generateUUID;
